<template>
  <el-form-item label="网页路径" style="width: 100%">
    <el-button type="primary" icon="plus" @click="handleAdd" style="margin-bottom: 15px"> 添加 </el-button>
    <el-table :data="modelValue" border height="262" style="width: 100%">
      <el-table-column label="路径">
        <template #default="{ row, $index }">
          <el-input v-model="modelValue[$index]" placeholder="请输入路径"></el-input>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="80px">
        <template #default="scope">
          <el-button link type="primary" icon="delete" @click="modelValue.splice(scope.$index, 1)">
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-form-item>
</template>
<script setup>
const emits = defineEmits(['change'])
const props = defineProps({
  modelValue: { type: Array, default: () => [] },
})

// 新增
const handleAdd = () => {
  props.modelValue.push('')
}
</script>
<style lang="scss" scoped></style>
